package com.jdyfy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jdyfy.dto.NoshowCountDTO;
import com.jdyfy.entity.Department;
import com.jdyfy.entity.DepartmentNoshow;
import com.jdyfy.mapper.DepartmentMapper;
import com.jdyfy.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jdyfy.entity.Department;

import java.util.List;


@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;


    //根据企业名称查询企业信息
    public Department getByDepartName(String departmentName) {
        return departmentMapper.getByDepartName(departmentName);
    }

    //根据企业名集合获取企业信息集合
    public List<Department> getDepartsByDepartNames(List<String> departmentNames) {
        return departmentMapper.getDepartsByDepartNames(departmentNames);
    }

    //获取供应商
    public List<Department> getSuppler(String departmentName,String departmentNumber) {
        departmentMapper.getNoshowCount();
        return departmentMapper.getSuppler(departmentName, departmentNumber);
    }

    public boolean addOrUpdate(DepartmentNoshow departmentNoshow) {
        return departmentMapper.addOrUpdate(departmentNoshow);
    }

    //获取爽约记录
    public List<NoshowCountDTO> getNoshowByDepartment(String departmentName) {
        return departmentMapper.getNoshowByDepartment(departmentName);
    }
}
